import request from '@/utils/request';

// 查询入库单列表
export function listReceiptOrder(query: Record<string, any>) {
  return request({
    url: '/wms/receiptOrder/list',
    method: 'get',
    params: query
  })
}

// 查询入库单详细
export function getReceiptOrder(orderId: string | number) {
  return request({
    url: '/wms/receiptOrder/' + orderId,
    method: 'get'
  })
}

// 新增入库单
export function addReceiptOrder(data: Record<string, any>) {
  return request({
    url: '/wms/receiptOrder',
    method: 'post',
    data: data
  })
}

// 修改入库单
export function updateReceiptOrder(data: Record<string, any>) {
  return request({
    url: '/wms/receiptOrder',
    method: 'put',
    data: data
  })
}

// 删除入库单
export function delReceiptOrder(orderId: string | number | string[]) {
  const ids = Array.isArray(orderId) ? orderId.join(',') : orderId;
  return request({
    url: '/wms/receiptOrder/' + ids,
    method: 'delete'
  })
}

// 导出入库单
export function exportReceiptOrder(query: Record<string, any>) {
  return request({
    url: '/wms/receiptOrder/export',
    method: 'post',
    data: query
  })
}

// 入库单审核
export function auditReceiptOrder(orderId: string | number, status: number) {
  return request({
    url: '/wms/receiptOrder/audit',
    method: 'put',
    data: { orderId, status }
  })
}

// 入库单入库
export function receiptReceiptOrder(orderId: string | number) {
  return request({
    url: '/wms/receiptOrder/receipt/' + orderId,
    method: 'put'
  })
}




